<?php
	$ls_gridname	= 'list_pph21';


// ----------------- >> Form Detail << ----------------- ?>

<script>
	console.clear();
	var f_status = function(val) {
        return (val == '1' ? '<img src="' + gs_path + '/content/images/ico_success.png" title="Sudah Dibayar" />' : '<img src="' + gs_path + '/content/images/delete.png" title="Belum Dibayar" />');
    };

    function reloadListThr(p) {
    	console.log(p);
		$('#<?php echo $ls_gridname; ?>').datagrid({
			queryParams: {
				idPeriode: p
			}
		});
    }

	$(function(){
		var lastIndex;
		$('#<?php echo $ls_gridname; ?>').datagrid({
			url:gs_path+'/'+controller+'/getdata/',
			queryParams: {
				idPeriode: $('#id_periode_fk').val()
			},
			// width:1000,
			height:300,
			rownumbers:true,
			pagination:true,
			// showFooter:true,
			fitColumns:true,
			frozenColumns: [[
				//{ field : 'ck', checkbox:true, width: 40, align: 'center' },
				{ field : 'id_karyawan_fk', title : 'NIK', width : 70, sortable:true },
				{ field : 'nama_karyawan', title : 'Nama', width : 200, sortable:true },
			]],
			columns:[[
				{ field : 'ket_jenis_cuti', title : 'jenis Cuti', width : 80, sortable:true },
                { field : 'lama_hari', title : 'Jml Hari', width : 40, sortable:true },
                { field : 'tgl_mulai', title : 'Timbul Cuti', width : 70, sortable:true },
                { field : 'tgl_selesai', title : 'Berakhir Cuti', width : 70, sortable:true },
                { field : 'tgl_bergabung', title : 'Tgl Bergabung', width : 70, sortable:true },
                { field : 'nilai', title : 'Bantuan cuti', width : 70, sortable:true, formatter:formatNumeric, align:"right" },
			]],
			toolbar:[
				{
					text:'Print',
					iconCls:'icon-print',
					handler:function(){
						// window.open(gs_path+'/'+controller+'/cetak?id_periode_fk='+$('#id_periode_fk').val(), 'myWin', 'height=500,width=700,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes');
						$.messager.alert('Info','Fitur print segera menyusul di update berikutnya','info');
					}
				}
				/*,'-',{
					text:'Detail Gaji 13',
					iconCls:'icon-edit',
					handler:function(){
						var oSel=$('#<?php echo $ls_gridname; ?>').datagrid('getSelected'); 
						if(oSel==null){ 
							alert('Please select row!'); 
						} else{ 
							var $popup = openPopup({ title: '&nbsp;', 
                                width: 600,
                                height: 350,
                                url: gs_path + '/' + controller + '/form_detail_gaji/'+oSel.id_g13_pk+'/'+oSel.nama_karyawan
                            });
						}
					}
				}*/
			]
		});
	});
</script>


<table id="<?php echo $ls_gridname; ?>" style="height:auto" iconCls="icon-edit" singleSelect="true" idField="itemid">
	<thead>
		<tr>
			<!-- <th field="id_karyawan_pk" width="70" >NIK</th> -->
	        <!-- <th field="nama_karyawan" width="150" >Nama</th> -->
	        <!-- <th field="ket_status" width="50" >Status</th>
	        <th field="alamat_jalan" width="250" >Alamat</th>
	        <th field="npwp" width="80" >NPWP</th>
	        <th field="no_ktp" width="80" >No KTP</th>
			<th field="nama_periode" width="90" >Periode</th>
	        <th field="gaji_pokok" width="100" formatter="formatNumeric" align="right">Gaji Pokok</th>
	        <th field="tunjangan" width="100" formatter="formatNumeric" align="right">Tunjangan</th>
	        <th field="tunjangan_pajak" width="100" formatter="formatNumeric" align="right">Tunjangan Pajak</th>
	        <th field="penghasilan_bruto" width="100" formatter="formatNumeric" align="right">Penghasilan Bruto</th>
	        <th field="biaya_jabatan" width="100" formatter="formatNumeric" align="right" >Biaya Jabatan</th>
	        <th field="jht" width="100" formatter="formatNumeric" align="right" >JHT</th>
	        <th field="total_pengurang" width="100" formatter="formatNumeric" align="right" >Total Pengurang</th>
	        <th field="penghasilan_neto" width="100" formatter="formatNumeric" align="right" >Penghasilan Neto</th>
	        <th field="ptkp" width="100" formatter="formatNumeric" align="right" >PTKP</th>
	        <th field="penghasilan_kena_pajak" width="100" formatter="formatNumeric" align="right" >Penghasilan Kena Pajak</th>
	        <th field="pajak" width="100" formatter="formatNumeric" align="right" >Pajak</th> -->
		</tr>
	</thead>
</table>